package com.shuma.upms.user.domain.dto;

import lombok.Data;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 用户注册数据传输对象
 */
@Data
public class UserRegisterDTO implements Serializable {
    private static final long serialVersionUID = 1L;

    @NotEmpty(message = "用户名不能为空")
    @Pattern(regexp = "^\\S{5,16}$", message = "用户名长度必须为5-16位非空字符")
    private String username;

    @NotEmpty(message = "密码不能为空")
    @Pattern(regexp = "^\\S{6,20}$", message = "密码长度必须为6-20位非空字符")
    private String password;

    @Email(message = "邮箱格式不正确")
    private String email;

    private String phone;
}